home *** CD-ROM | disk | FTP | other *** search
- Path: charnel.ecst.csuchico.edu!sjonni
- From: sjonni@ecst.csuchico.edu (Sigurjon Fridsonsson)
- Newsgroups: comp.lang.c++,alt.winsock
- Subject: Help! The MVC++ CSocket class
- Date: 4 Mar 1996 22:40:36 GMT
- Organization: California State University, Chico
- Message-ID: <4hfrh4$kc3@charnel.ecst.csuchico.edu>
- NNTP-Posting-Host: guzzler.ecst.csuchico.edu
-
- Newsgroups: comp.lang.c++,alt.winsock
- Subject: Help! The CSocket class in MVC++4.0
- Summary:
- Followup-To:
- Distribution:
- Organization: California State University, Chico
- Keywords:
- Cc:
-
- Help!
-
- I'm trying to use MFC's CSocket class to send a simple echo request and
- then read the responce. The following is a stripped down version of my
- code (in MVC++4.0). Can anyone tell my what I'm doing wrong.
- I can send the request but never get a responce!
-
- All comments will be appreciated.
-
- Thanks, Sjonni
-
- sjonni@ecst.csuchico.edu
-
- ----------------------------8><-----------CUT HERE ------------------
-
- CSocket* sock;
- BYTE buffer[50];
- int err;
-
- if (!AfxSocketInit())
- return;
-
- sock = new CNetmSocket();
-
- err = sock->Create(0,SOCK_DGRAM);
- err = sock->SendTo("echodataechodata",16,IPPORT_ECHO,"111.22.33.4",0);
- if( err < 0 )
- err = sock->GetLastError();
-
- Sleep(1000);
-
- err = sock->Receive(buffer,50);
- if( err < 0 )
- err = sock->GetLastError();
-
- delete sock;
- sock = NULL;
- return;
-
-